package com.polaris.live.popup.party

import android.content.Context
import com.lxj.xpopup.core.CenterPopupView
import com.polaris.live.R
import com.polaris.live.common.ext.setOnSingleClickListener
import com.polaris.live.databinding.DialogPartyHangUpBinding

/**
 * PartyHangUpDialog
 *
 * @author Created by 天晴 on 2024/3/7 18:15
 * @since 1.0.0
 **/
class PartyHangUpDialog(
    context: Context,
    private val onCloseLiveCallBack: () -> Unit,
) : CenterPopupView(context) {

    override fun getImplLayoutId(): Int {
        return R.layout.dialog_party_hang_up
    }

    private lateinit var mBinding: DialogPartyHangUpBinding

    override fun onCreate() {
        super.onCreate()
        mBinding = DialogPartyHangUpBinding.bind(popupImplView)

        mBinding.apply {
            cancel.setOnSingleClickListener {
                dismiss()
            }
            closeLive.setOnSingleClickListener {
                onCloseLiveCallBack.invoke()
                dismiss()
            }
        }
    }
}